Conversation
…hes; add request new matches API for participants that creates a new Matching task
…so that all time slots but start at the 0 or 30, and be 30 minutes in length
… test environment locally
…t double-booking volunteers
- Matches default to awaiting_volunteer_acceptance status
- Volunteers must accept matches before participants can see them
- Add GET /matches/volunteer/me and POST /matches/{id}/accept-volunteer endpoints
- Validate volunteers have availability before accepting matches
- Add pending_volunteer_request field to track participant requests
…equest new volunteers flow is done. todo: handle other cases for landing page like when a match is confirmed and call is pending or when a call is completed. also the scheduling, request new time flows + the contact page + styling for mobile
…ed match + updated volunteer card styling for these cases and fetching the user summary from the volunteer_data table
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| # Attach volunteer's general availability as suggested times | ||
| self._attach_initial_suggested_times(match, volunteer) | ||
|
|
||
| # Transition status to "pending" so participant can see it | ||
| self._set_match_status(match, "pending") |
There was a problem hiding this comment.
Clear pending request flag when volunteer accepts match
When a volunteer accepts a match the service transitions the match to pending but never resets match.participant.pending_volunteer_request. That flag is set to True when a participant requests new volunteers and the dashboard hides all match content while it remains set. As a result, participants continue to see “request pending” even after volunteers accept and suggested times are generated. The acceptance flow should unset the pending flag so newly available matches become visible.
Useful? React with 👍 / 👎.
# Participant Dashboard Frontend
## Overview
This PR implements a comprehensive participant dashboard that allows
participants to view their volunteer matches, manage match statuses, and
request new volunteers. It includes both frontend UI components and
backend API endpoints to support the full match management workflow.
## Features
### Frontend
- **Participant Dashboard** (`/participant/dashboard`)
- Landing page with sidebar navigation (Matches, Contact tabs)
- Dynamic header messages based on match state
- User avatar display in header
- **Match Display Components**
- `VolunteerCard`: Displays pending matches with volunteer details
(name, pronouns, age, timezone, diagnosis, overview, treatments,
experiences)
- `ConfirmedMatchCard`: Displays confirmed/scheduled matches with
timeline layout (date badge, time, vertical teal bar, volunteer info)
- Both cards show volunteer overview from `volunteer_data` table
- **Request New Matches Flow**
- Inline form when all matches are completed (no card border, heading in
header area)
- Modal flow for requesting new matches from pending matches
- Success confirmation modal after submission
- Form includes optional message/notes field
- **Date/Time Utilities**
- `formatDateRelative()`: "Today", "Tomorrow", or day of week
- `formatDateShort()`: "Feb 26" format
- `formatTime()`: "12:00PM" format
### Backend
- **Match Management APIs**
- `GET /matches/me`: Get all matches for current participant with
volunteer details
- `POST /matches/request-new-volunteers`: Request new volunteers
(soft-deletes active matches, creates task, sets pending flag)
- `POST /matches/{match_id}/schedule`: Schedule a match (participant
selects time)
- `POST /matches/{match_id}/cancel-participant`: Cancel match as
participant
- `POST /matches/{match_id}/cancel-volunteer`: Cancel match as volunteer
- `POST /matches/{match_id}/request-new-times`: Request new time options
- `POST /matches/{match_id}/accept`: Volunteer accepts a match
- **Match Service Enhancements**
- Soft deletion support (`deleted_at` column)
- Match status management with cleanup logic
- Volunteer summary includes timezone and overview from `user_data` and
`volunteer_data` tables
- Prevents double-booking volunteers
- Handles match state transitions (pending → confirmed → completed)
- **Database Changes**
- Added `deleted_at` column to `matches` table (soft deletion)
- Added `pending_volunteer_request` boolean field to `users` table
- Added `description` column to `tasks` table
- **Time Block Validation**
- Updated `TimeRange` to accept half-hour boundaries
- All time slots must start at 0 or 30 minutes, be 30 minutes in length
## Database Migrations
- `d87b1000d48b`: Add soft deletion to matches table
- `14fdeccc883f`: Add pending_volunteer_request field to users table
- `e3f0a5b4b7c4`: Add task description column
## TODOs
- Schedule flow not yet implemented (placeholder handler)
- Cancel call flow not yet implemented (placeholder handler)
- View contact details flow not yet implemented (placeholder handler)
- Contact tab shows placeholder message
- Mobile styling
- Edit profile pages not yet implemented
Participant Dashboard Frontend
Overview
This PR implements a comprehensive participant dashboard that allows participants to view their volunteer matches, manage match statuses, and request new volunteers. It includes both frontend UI components and backend API endpoints to support the full match management workflow.
Features
Frontend
Participant Dashboard (
/participant/dashboard)Match Display Components
VolunteerCard: Displays pending matches with volunteer details (name, pronouns, age, timezone, diagnosis, overview, treatments, experiences)ConfirmedMatchCard: Displays confirmed/scheduled matches with timeline layout (date badge, time, vertical teal bar, volunteer info)volunteer_datatableRequest New Matches Flow
Date/Time Utilities
formatDateRelative(): "Today", "Tomorrow", or day of weekformatDateShort(): "Feb 26" formatformatTime(): "12:00PM" formatBackend
Match Management APIs
GET /matches/me: Get all matches for current participant with volunteer detailsPOST /matches/request-new-volunteers: Request new volunteers (soft-deletes active matches, creates task, sets pending flag)POST /matches/{match_id}/schedule: Schedule a match (participant selects time)POST /matches/{match_id}/cancel-participant: Cancel match as participantPOST /matches/{match_id}/cancel-volunteer: Cancel match as volunteerPOST /matches/{match_id}/request-new-times: Request new time optionsPOST /matches/{match_id}/accept: Volunteer accepts a matchMatch Service Enhancements
deleted_atcolumn)user_dataandvolunteer_datatablesDatabase Changes
deleted_atcolumn tomatchestable (soft deletion)pending_volunteer_requestboolean field touserstabledescriptioncolumn totaskstableTime Block Validation
TimeRangeto accept half-hour boundariesDatabase Migrations
d87b1000d48b: Add soft deletion to matches table14fdeccc883f: Add pending_volunteer_request field to users tablee3f0a5b4b7c4: Add task description columnTODOs